package com.yunc.user.job;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * springcloud定时任务，只选择一个
 *
 * @author taocongcong
 * @create 2021-05-20 16:01
 */
@Component
public class WorkTask {

    @Value("${spring.application.name}")
    private String serviceName;

    /**
     * 5秒更新一次
     */
    @Scheduled(fixedDelay = 5000)
    public void doWork(){
        /*if (!IPV4Util.ipCompare(serviceUrl())) {
            return;
        }*/
        // System.out.println("服务,地址为："+IPV4Util.getIpAddress()+",正在执行task任务");
    }

}
